//
//  Copyright: (C) 2006-2008 by Kandalu Software 
//  London
//  info@kandalu.net
//

#import <Cocoa/Cocoa.h>
#import <Carbon/Carbon.h>

//
// Check for availability of Mac OS X 10.4 "Tiger"
//
BOOL CheckForSystemRequirements()
{
	long response;	
	OSStatus status = Gestalt(gestaltSystemVersion, &response);
	BOOL ok = ((noErr == status) && (response >= 0x00001040));

  if (!ok)
  {
		DialogRef alertDialog;
		CreateStandardAlert(kAlertStopAlert, 
                        CFCopyLocalizedString(CFSTR("Mac OS X v10.4 \"Tiger\" (minimum) is required "
                                                    "for this application"), nil),
                        NULL, NULL, &alertDialog);
		RunStandardAlert(alertDialog, NULL, NULL);
	}
	return ok;  
}

int main(int argc, char *argv[])
{
  if (CheckForSystemRequirements())
    return NSApplicationMain(argc, (const char **) argv);
  //else
  return -1;
}
